﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XYTXL.API;
using XYTXL.Data;
using XYTXL.AppCode;

namespace XYTXL.Web.View.UCMangForm
{
    public partial class TZGG : FormUControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 重写父类的保存数据方法
        /// </summary>
        /// <param name="intFormID">数据ID</param>
        /// <param name="strActionType">操作类型("ADD":"添加","UPDATE":"修改")</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType, int pid)
        {
            //执行 父类的方法
            base.SaveForm(intFormID, strActionType);

            //保存数据
            JH_MH_TZGG Model = new JH_MH_TZGGB().GetEntity(d => d.ID == intFormID);
            Model.Title = txtTitle.Text;
            Model.Details = txtDetails.Text;
            Model.Files = txtFiles.Text;
            return new JH_MH_TZGGB().Update(Model);
        }

        public override void initMangerForm(int intFormID, string strActionType)
        {
            base.initMangerForm(intFormID, strActionType);
            JH_MH_TZGG Model = new JH_MH_TZGGB().GetEntity(d => d.ID == intFormID);
            txtTitle.Text = Model.Title;
            txtDetails.Text = Model.Details;
            txtFiles.Text = Model.Files;
        }
    }
}